package com.gxa.ssm251.util;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class JsonResult implements Serializable {
//    private String code;
//    private String msg = "";
//    private Object data;


    //为了随时能够添加数据,将JsonResult改造成包含Map的类

    private final Map<String,Object> jsonMap=new HashMap<>();

    public void setCode(String code) {
        jsonMap.put("code",code);
    }
    public void setMsg(String msg) {
        jsonMap.put("msg",msg);
    }
    public void setData(Object data) {
        jsonMap.put("data",data);
    }
    public void setCount(Integer count) {
        jsonMap.put("count",count);
    }
    public void setValue(String key,Object value){
        jsonMap.put(key,value);
    }
    public Map<String,Object> getValues(){
        return jsonMap;
    }
}
